package com.gdteam.kernel.event.impl;

import org.apache.tapestry5.ioc.annotations.EagerLoad;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.slf4j.Logger;

import com.gdteam.kernel.event.Context;
import com.gdteam.kernel.event.Event;
import com.gdteam.kernel.event.EventFactory;
import com.gdteam.kernel.main.ServiceManager;

@EagerLoad
public class DefaultEventFactory implements EventFactory {
    
    ServiceManager srvmgr = null;
    Logger log = null;
    Context ctxt = null;
    
    public DefaultEventFactory(Logger log, @Inject ServiceManager mgr,@Inject Context ctxt) {
        this.srvmgr = mgr;
        this.log = log;
        this.ctxt = ctxt;
    }
    
    public Event get(String type) {
        Event res = new DefaultEvent(this.log, type,this.ctxt);
        return res;
    }

    public String getName() {
        return FQN;
    } 

}
